import { Toast } from "vant";
import succIcon from "../assets/success.png";
import failIcon from '../assets/fail.png'

Toast.toast = function (msg, isSucc = true) {
    if (msg.length > 8) {
        Toast({
            message: msg,
            className: "messageToast"
        });
    } else {
        if (isSucc) {
            Toast({
                message: msg,
                icon: succIcon
            });
        } else {
            Toast({
                message: msg,
                icon: failIcon,
            });
        }
    }
}

export default Toast